<?php

	$TEMP->set_file(array('handle' => DIR_IFRAME_VIEW . 'studentProfile.html'));
	
	$studID 	= $_GET['id'];
	
	$studentInfo = $STUD->getStudentInformation($studID);
	
	if ( !empty($studentInfo) ) {
		
		/*
		Array
		(
			[stud_idPK] => 1
			~[stud_no] => STUD-0001
			~[first_name] => Rynelle Stud
			~[last_name] => Coronacion
			~[middle_name] => Pinsan
			[course_idFK] => 1
			~[picture] => 
			~[birthdate] => 1988-09-17
			~[gender] => male
			~[email] => rynelle.coronacion@westbay.com.ph
			~[contact_no] => +639165290788
			~[address] => 75 Be Manaol Brgy. Manaol Nagcarlan Laguna
			~[guardian] => Randy Coronacion
			~[course_code] => BSIT
			~[course_major] => 
			~[course_desc] => Bachelor Of Science In Information Technology
			~[dept_desc] => College Of Computer Studies
		)
		*/
		
		
		$picture = ( file_exists(DIR_UPLOADS . $studentInfo['picture']) && !empty($studentInfo['picture'])) ? $studentInfo['picture'] : 'person_blank.jpg';
		
		$courseMajor = !empty($studentInfo['course_major']) ? ' (' . $studentInfo['course_major'] . ')' : '';
		
		$TEMP->set_var(array('account_no' 	=> $studentInfo['stud_no'],
							 'name' 		=> $studentInfo['first_name'] . ' ' . $studentInfo['middle_name'] . ' ' . $studentInfo['last_name'],
							 'bdate' 		=> FdY($studentInfo['birthdate']),
							 'gender' 		=> firstUpperCase($studentInfo['gender']),
							 'email' 		=> $studentInfo['email'],
							 'contact_no' 	=> $studentInfo['contact_no'],
							 'address' 		=> $studentInfo['address'],
							 'guardian' 	=> $studentInfo['guardian'],
							 'username' 	=> $studentInfo['log_user'],
							 'course'		=> $studentInfo['course_code'] . $courseMajor,
							 'year_sem'		=> 'YEAR SEMESTER',
							 'section'		=> 'SECTION 123',
							 'department'	=>  $studentInfo['dept_desc'],
							 'picture_stud'	=> '<img src="' . DIR_UPLOAD . $picture . '" width="100" height="100" border="0" class="picture-border-view"/>',
							 ));
	}
?>